import { getCheckGroupList, getCheckGroupUpdate, getAutoNewTime } from '../../../vuex/action'

export default {
  name: 'expert-group',
  data() {
    return {
      lists: [],
      checkTime: null
    }
  },
  vuex: {
    actions: {
      xGetCheckGroupList: getCheckGroupList,
      xGetCheckGroupUpdate: getCheckGroupUpdate,
      xGetAutoNewTime: getAutoNewTime
    }
  },
  methods: {
    getList() {
      this.xGetCheckGroupList({
        type: 4
      })
        .then((data) => {
          this.checkTime = data.rankAudit
          this.lists = data.list
        })
    },
    showHide(list) {
      list.status = list.status === 0 ? 1 : 0
      this.xGetCheckGroupUpdate({
        type: list.type,
        refId: list.refId,
        status: list.status
      })
        .then((data) => {
          // list.status = status
        })
    },
    check() {
      this.xGetAutoNewTime({
        type: 4
      })
        .then((data) => {
          this.checkTime = data.data.rankAudit
          window.location.reload()
        })
    }
  },
  ready() {
    this.getList()
  }
}
